﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LeEdu.MODEL;
using LeEdu.BLL;
using System.IO;

namespace LeEdu.Controllers
{
    public class GroupController : Controller
    {

        #region 富文本编辑器
        /// <summary>
        /// 富文本编辑器
        /// </summary>
        public GroupController()
        {
            ValidateRequest = false;
        }
        #endregion 富文本编辑器

        #region 实例化BLL层
        /// <summary>
        /// 实例化MESSAGE (站内通知)
        /// </summary>
        BaseBLL<Message> messagebll = new BaseBLL<Message>();
        /// <summary>
        /// 实例化BULLETIN (网站公告)
        /// </summary>
        BaseBLL<Bulletin> bulletinbll = new BaseBLL<Bulletin>();

        /// <summary>
        /// 实例化
        /// </summary>
        BaseBLL<Group> groupbll = new BaseBLL<Group>();
        /// <summary>
        /// 实例化上下文栏目
        /// </summary>
        BaseBLL<Columnss> colbll = new BaseBLL<Columnss>();
        /// <summary>
        /// 实例化资讯
        /// </summary>
        BaseBLL<Information> infobll = new BaseBLL<Information>();

        /// <summary>
        /// 实例化标签
        /// </summary>
        BaseBLL<Lable> labll = new BaseBLL<Lable>();
        /// <summary>
        /// 实例化USERANDGROUP类
        /// </summary>
        BaseBLL<UserAndGroup> uagbll = new BaseBLL<UserAndGroup>();
        /// <summary>
        /// 实例化话题功能
        /// </summary>
        BaseBLL<Topicshi> Topicbll = new BaseBLL<Topicshi>();
        #endregion

        #region 首页
        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            return View();
        }
        #endregion

        #region 后台——运营——资讯管理
        /// <summary>
        /// 后台——运营——资讯管理
        /// </summary>
        /// <returns></returns>
        public ActionResult GroupIndex(int? ColumnssID, string INTITLE, string ATTRIBUTE, int? INSTATE, int pageIndex = 1)
        {
            //获取栏目列表
            List<Columnss> sta = colbll.GetAll();
            List<Columnss> stb = new List<Columnss>();
            foreach (var item in sta.Where(p => p.CLMGR == 0))
            {
                item.CLNAME =  item.CLNAME;
                stb.Add(item);
                int tt = 1;
                About(stb, sta, item.ColumnssID, tt);
            }
            ViewBag.collist = stb;

            ViewBag.ColumnssID = ColumnssID;
            ViewBag.INTITLE = INTITLE;
            ViewBag.ATTRIBUTE = ATTRIBUTE;
            ViewBag.INSTATE = INSTATE;
            //根据条件查询集合
            List<LeEdu.MODEL.Information> stalist = infobll.GetAll().Where(t =>
                (ColumnssID == null ? true : t.ColumnssID == ColumnssID)
                && (string.IsNullOrEmpty(INTITLE) ? true : t.INTITLE.Contains(INTITLE))
                && (string.IsNullOrEmpty(ATTRIBUTE) ? true : t.ATTRIBUTE.Contains(ATTRIBUTE))
                && (INSTATE == null ? true : t.INSTATE == INSTATE)).ToList();
            ViewBag.info = NewPagingInfo(stalist, pageIndex);
            return View();
        }
        #endregion

        #region 根据条件分页和查询
        /// <summary>
        /// 根据条件分页和查询
        /// </summary>
        /// <param name="stalist"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public List<Information> NewPagingInfo(List<Information> stalist, int pageIndex)
        {
            //每页显示条数
            int pageSize = 2;
	

            int pageCount = Convert.ToInt32(Math.Ceiling(stalist.Count() / (decimal)pageSize));
			if (pageIndex > pageCount) {
				pageIndex = pageCount;
			}
            if (pageCount < 1)
            {
                pageCount = 1;
            }
            List<Information> stb = stalist.OrderByDescending(t => t.ID).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
            ViewBag.pageIndex = pageIndex;
            ViewBag.pagesize = pageSize;
            ViewBag.pageCount = pageCount;
            return stb;
        }
        #endregion

        #region 批量删除
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="listid"></param>
        /// <returns></returns>
        public ActionResult DelInfoList(string listid)
        {
            string[] id = listid.Split(',');
            //循环删除id
            foreach (var item in id)
            {
                infobll.Del(infobll.Search(Convert.ToInt32(item)));
            }
            return Content("1");
        }
        #endregion

        #region 前台一一运营一一资讯(id为栏目编号)
        /// <summary>
        /// 前台一一运营一一资讯(id为栏目编号)
        /// </summary>
        /// <returns></returns>
        public ActionResult GroupIA(int id = 0)
        {
            if (id > 0)
            {
                //根据id找对象
                Columnss std = colbll.Search(id);
                if (std.CLMGR == 0)
                {
                    ViewBag.stb = colbll.GetAll().Where(t => t.CLMGR == 0).ToList();
                }
                else
                {
                    //显示根路径
                    //获取所有的栏目
                    List<Columnss> sta = colbll.GetAll();
                    //获得新栏目
                    List<Columnss> stb = new List<Columnss>();
                    Newcolumn(stb, sta, id);
                    ViewBag.stb = stb;
                }
                //查找资讯
                List<Information> infolist = infobll.GetAll().Where(f => f.ColumnssID == id).ToList();
                ViewBag.infolist = infolist;
                //查找其子栏目
                List<Columnss> collist = colbll.GetAll().Where(t => t.CLMGR == id).ToList();
                ViewBag.collist = collist;
                ViewBag.id = id;
            }
            else
            {
                ViewBag.stb = colbll.GetAll().Where(t => t.CLMGR == 0).ToList();

                //查找资讯
                Columnss str = colbll.GetAll().Where(t => t.CLMGR == 0).FirstOrDefault();
                List<Information> infolist = infobll.GetAll().Where(f => f.ColumnssID == str.ColumnssID).ToList();
                ViewBag.infolist = infolist;
                //查找其子栏目
                List<Columnss> collist = colbll.GetAll().Where(t => t.CLMGR == str.ColumnssID).ToList();
                ViewBag.collist = collist;
            }
            //获取热门的资讯
            List<Information> infore = infobll.GetAll().OrderByDescending(t => t.ID).Where(t => t.ATTRIBUTE.Contains("顶")).Take(3).ToList();
            ViewBag.infore = infore;

            //获取推荐的资讯
            List<Information> infotui = infobll.GetAll().OrderByDescending(t => t.ID).Where(t => t.ATTRIBUTE.Contains("推荐")).Take(2).ToList();
            ViewBag.infotui = infotui;
            return View();
        }
        #endregion

        #region 根据MGR找他的根路径
        /// <summary>
        /// 根据MGR找他的根路径
        /// </summary>
        /// <param name="id"></param>
        public List<Columnss> Newcolumn(List<Columnss> stb, List<Columnss> sta, int id)
        {
            Columnss str = colbll.Search(id);
            int mgr = Convert.ToInt32(str.CLMGR);
            stb.Insert(0, str);
            int count = colbll.GetAll().Where(t => t.ColumnssID == mgr).Count();
            if (count > 0)
            {
                Newcolumn(stb, sta, mgr);
            }
            return stb;
        }
        #endregion


        #region 前台——运营——点击一个栏目查看是否有子栏目
        /// <summary>
        /// 前台——运营——点击一个栏目查看是否有子栏目
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult SearchColumnMGR(int id)
        {
            int stb = colbll.GetAll().Where(t => t.CLMGR == id).Count();
            if (stb > 1)
            {

                return Json(id);
            }
            else
            {
                return Content("0");
            }

        }
        #endregion


        #region 前台——运营——点击资讯跳转到具体页面
        /// <summary>
        /// 前台——运营——点击资讯跳转到具体页面
        /// </summary>
        /// <returns></returns>
        public ActionResult article(int id)
        {
            //查找对应的资讯
            Information info = infobll.Search(id);
            ViewBag.info = info;

            //获取热门的资讯
            List<Information> infolist = infobll.GetAll().OrderByDescending(t => t.ID).Where(t => t.ATTRIBUTE.Contains("顶")).Take(3).ToList();
            ViewBag.infolist = infolist;

            //获取推荐的资讯
            List<Information> infotui = infobll.GetAll().OrderByDescending(t => t.ID).Where(t => t.ATTRIBUTE.Contains("推荐")).Take(2).ToList();
            ViewBag.infotui = infotui;
            return View();
        }
        #endregion

        #region  前台--添加小组页面
        /// <summary>
        /// 前台--添加小组页面
        /// </summary>
        /// <returns></returns>
        public ActionResult GroupCreate()
        {
            return View();
        }
        #endregion

        #region 前台--添加小组
        /// <summary>
        /// 前台--添加小组
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GroupCreate(FormCollection FC)
        {
            UserInfo user = Session["User"] as UserInfo;
            if (user != null && user.RoleId == 0)
            {
                string gname = FC["GroupName"].ToString();
                string GroupIntroduces = FC["GroupIntroduces"];
                Group g = groupbll.GetAll().Where(p => p.GNAME == gname).FirstOrDefault();
                if (g != null)
                {
                    return Content("<script>alert('已存在此小组！请重新命名！'); location.href = '/Group/GroupCreate';</script>");
                }
                else
                {
                    Group grou = new Group();
                    grou.GNAME = gname;
                    grou.GINTROGUCE = GroupIntroduces;
                    grou.GLOGO = "group.png";
                    grou.GBACKGROUND = "background_group.jpg";
                    grou.GSTATE = 1;
                    grou.GSTATTIME = DateTime.Now;
                    groupbll.AddEntity(grou);

                    Group gs = groupbll.GetAll().Where(p => p.GNAME == gname).FirstOrDefault();
                    UserAndGroup uag = new UserAndGroup();
                    uag.GroupID = gs.GroupID;
                    uag.GPOSITION = 0;
                    uag.STARTTIME = DateTime.Now;
                    uag.UserInfoID = user.UserInfoId;

                    uagbll.AddEntity(uag);

                    return Content("<script> location.href = '/Group/GroupHomepage/" + gs.GroupID + "';</script>");
                }
            }
            else
            {
                return Content("<script>alert('只允许管理员添加！'); location.href = '/Home/Index';</script>");
            }
        }
        #endregion

        #region 前台--所有小组显示页面
        /// <summary>
        /// 前台--所有小组显示页面
        /// </summary>
        /// <returns></returns>
        public ActionResult GroupAll()
        {
            List<Group> list = groupbll.GetAll().Where(p => p.GSTATE == 1).ToList();

            ViewBag.DAO = list.OrderByDescending(p => p.UserAndGroup.Count).Take(6).ToList();
            ViewBag.HUA = new BaseBLL<Topicshi>().GetAll().OrderByDescending(p => p.TSTARTTIME).ToList();

            UserInfo user = Session["User"] as UserInfo;
            ViewBag.User = user;
            if (user != null)
            {
                ViewBag.Group = uagbll.GetAll().Where(p => p.UserInfoID == user.UserInfoId && p.GPOSITION == 0).ToList(); ;
            }
            ViewBag.ZU = groupbll.GetAll().OrderByDescending(p => p.GSTATTIME).ToList();

            return View();
        }
        #endregion

        #region  前台---小组主页
        /// <summary>
        /// 前台---小组主页
        /// 改过ID为1
        /// </summary>
        /// <returns></returns>
        public ActionResult GroupHomepage(int id=1)
        {
            Group group = groupbll.Search(id);

            if (group.GSTATE == 1)
            {
                UserInfo userinfo = Session["User"] as UserInfo;
                List<UserAndGroup> list = uagbll.GetAll().Where(p => p.GroupID == id).ToList();
                ViewBag.Count = list.Count();
                ViewBag.Ren = 0;
                if (userinfo != null)
                {
                    ViewBag.Ren = list.Where(p => p.UserInfoID == userinfo.UserInfoId).Count();
                }

                UserAndGroup user = list.Where(p => p.GPOSITION == 0).FirstOrDefault();
                ViewBag.HUA = new BaseBLL<Topicshi>().GetAll().Where(p => p.GroupID == id).OrderByDescending(p => p.TSTARTTIME).ToList();
                ViewBag.HCount = new BaseBLL<Topicshi>().GetAll().Where(p => p.GroupID == id && p.UserInfoID == user.UserInfoID).ToList().Count();
                if (ViewBag.HCount < 1)
                {
                    ViewBag.HCount = 0;
                }
                ViewBag.ZU = user;
                ViewBag.ZUI = list.OrderByDescending(p => p.STARTTIME).ToList();
                return View(group);
            }
            else
            {
                return Content("<script> alert('本小组已关闭！请选择其他小组！！！'); location.href = '/Group/GroupAll';</script>");
            }
        }
        #endregion

        #region 话题界面
		public ActionResult GroupSearchTopic() {
			return View();
		}
        /// <summary>
        /// 话题界面
        /// </summary>
        /// <param name="TTITLE"></param>
        /// <returns></returns>
		  [HttpPost]
        public ActionResult GroupSearchTopic(int id, string TTITLE)
        {
            List<Topicshi> lst = Topicbll.GetAll().Where(p => p.TTITLE.Contains(TTITLE) && p.GroupID == id).ToList();
            ViewBag.tops = lst;
            Group group = groupbll.Search(id);
            return View(group);
        }
        #endregion


        #region 前台--小组--小组设置
        /// <summary>
        /// 前台--小组--小组设置
          /// 改的【表情】=1
        /// </summary>
        /// <returns></returns>
        public ActionResult GroupSetting(int id=1)
        {
            Group group = groupbll.Search(id);
            return View(group);
        }
        #endregion

        #region 前台--小组--修改图标
        /// <summary>
        /// 前台--小组--修改图标、
        /// 改的【表情】=1
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GroupImg(int id=1)
        {

            //添加图片       
            HttpPostedFileBase file = Request.Files["feedbackfile"];
            //判断图片非空
            if (file != null)
            {
                //修改图片名称（区分重名）
                string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Path.GetExtension(file.FileName);
                //获取路径
                string FilPpath = Path.Combine(HttpContext.Server.MapPath("~/Img"), Path.GetFileName(filename));
                //保存导服务器
                file.SaveAs(FilPpath);
                Group group = groupbll.Search(id);
                group.GLOGO = filename;
                groupbll.Edit(group);

                return RedirectToAction("GroupHomepage/" + id + "");
            }
            //添加背景图片       
            HttpPostedFileBase files = Request.Files["Background"];
            //判断背景图片非空
            if (files != null)
            {
                //修改图片名称（区分重名）
                string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Path.GetExtension(files.FileName);
                //获取路径
                string FilPpath = Path.Combine(HttpContext.Server.MapPath("~/Img"), Path.GetFileName(filename));
                //保存导服务器
                files.SaveAs(FilPpath);
                Group group = groupbll.Search(id);
                group.GBACKGROUND = filename;
                groupbll.Edit(group);

                return RedirectToAction("GroupHomepage/" + id + "");

            }
            return RedirectToAction("GroupSetting/" + id + "");
        }
        #endregion

        #region 前台--小组--编辑
        /// <summary>
        /// 前台--小组--编辑
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult EditGroup(int id, FormCollection FC,Group gp)
        {
            Group group = groupbll.Search(id);
            group.GNAME = FC["GNAME"].ToString();
            group.GINTROGUCE = FC["GINTROGUCE"].ToString();
            if (groupbll.Edit(group))
            {
                return RedirectToAction("GroupHomepage/" + id + "");
            }
            else
            {
                return RedirectToAction("GroupSetting/" + id + "");
            }
        }
        #endregion

        #region 前台--小组---添加话题页面
        /// <summary>
        /// 前台--小组---添加话题页面
        /// 改的【表情】=1
        /// </summary>
        /// <returns></returns>
        public ActionResult HuaTiCreate(int id)
        {
            return View(groupbll.Search(id));
        }
        #endregion

        #region 前台--小组--小组成员
        /// <summary>
        /// 前台--小组--小组成员
        /// 改的【表情】=1
        /// </summary>
        /// <returns></returns>s
        public ActionResult TeamMember(int id=1)
        {
            Group group = groupbll.Search(id);
            List<UserAndGroup> list = uagbll.GetAll().Where(p => p.GroupID == id).ToList();
            ViewBag.Count = list.Count();
            ViewBag.ZU = list.Where(p => p.GPOSITION == 0).FirstOrDefault();
            ViewBag.FU = list.Where(p => p.GPOSITION == 1).ToList();
            ViewBag.YUAN = list.Where(p => p.GPOSITION == 2).ToList();
            return View(group);
        }
        #endregion

        #region 前台--小组--话题讨论页面
        /// <summary>
        /// 前台--小组--话题讨论页面
        /// 改的【表情】=1
        /// </summary>
        /// <returns></returns>
        public ActionResult HuaTiThread(int id=1)
        {
            return View(groupbll.Search(id));
        }
        #endregion

        #region 前台--小组--撤销副组长
        /// <summary>
        /// 前台--小组--撤销副组长
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult RemoveZu(int id, FormCollection FC)
        {
            string fu = "0," + FC["FUZU"];
            string[] str = fu.Split(',');
            foreach (var item in str)
            {
                if (Convert.ToInt32(item) != 0)
                {
                    UserAndGroup uag = uagbll.GetAll().Where(p => p.GroupID == id && p.UserInfoID == Convert.ToInt32(item)).FirstOrDefault();
                    uag.GPOSITION = 2;
                    uagbll.Edit(uag);
                }
            }
            return RedirectToAction("TeamMember/" + id + "");
        }
        #endregion

        #region 设为副组长
        /// <summary>
        /// 设为副组长
        /// </summary>
        /// <returns></returns>
        public ActionResult EditZU(int id, string str)
        {
            string[] list = str.Split(',');
            foreach (var item in list)
            {
                if (Convert.ToInt32(item) != 0)
                {
                    UserAndGroup uag = uagbll.GetAll().Where(p => p.GroupID == id && p.UserInfoID == Convert.ToInt32(item)).FirstOrDefault();
                    uag.GPOSITION = 1;
                    uagbll.Edit(uag);
                }
            }
            return RedirectToAction("TeamMember/" + id + "");
        }
        #endregion

        #region 踢出成员
        /// <summary>
        /// 踢出成员
        /// </summary>
        /// <returns></returns>
        public ActionResult DelZU(int id, string str)
        {
            string[] list = str.Split(',');
            foreach (var item in list)
            {
                if (Convert.ToInt32(item) != 0)
                {
                    UserAndGroup uag = uagbll.GetAll().Where(p => p.GroupID == id && p.UserInfoID == Convert.ToInt32(item)).FirstOrDefault();
                    uagbll.Del(uag);
                }
            }
            return RedirectToAction("TeamMember/" + id + "");
        }
        #endregion

        #region 查询成员界面
        /// <summary>
        /// 查询成员界面
        /// </summary>
        /// <returns></returns>
        public ActionResult SearchGroup()
        {
            List<Group> lst = groupbll.GetAll().Where(p => p.GSTATE == 1).ToList();
            return View(lst);
        }
        #endregion

        #region 查询成员
        /// <summary>
        /// 查询成员
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult SearchGroup(string GNAME)
        {
            List<Group> lst = groupbll.GetAll().Where(p => p.GNAME.Contains(GNAME) && p.GSTATE == 1).ToList();
            return View("SearchGroup", lst);
        }
        #endregion

        #region 前台--小组--话题添加
        /// <summary>
        /// 前台--小组--话题添加
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult HuaTiCreate(FormCollection FC)
        {
            UserInfo user = Session["User"] as UserInfo;
            int id = Convert.ToInt32(FC["GroupID"]);
            List<Topicshi> shi = new BaseBLL<Topicshi>().GetAll().Where(p => p.TTITLE == FC["HTITLE"].ToString()).ToList();
            if (shi.Count < 1)
            {
                Topicshi top = new Topicshi();
                top.TTITLE = FC["HTITLE"];
                top.TNAME = FC["HCONTENT"];
                top.UserInfoID = user.UserInfoId;
                top.GroupID = Convert.ToInt32(FC["GroupID"]);
                top.TSTATE = 1;
                top.TSTARTTIME = DateTime.Now;
                new BaseBLL<Topicshi>().AddEntity(top);
                Topicshi ttt = new BaseBLL<Topicshi>().GetAll().Where(p => p.TTITLE == FC["HTITLE"]).FirstOrDefault();
                return RedirectToAction("SreachTopic/" + ttt.ID + "");
            }
            else
            {
                return Content("<script> alert('已存在此话题！'); location.href = '/Group/HuaTiCreate/" + id + ";</script>");
            }
        }
        #endregion

        #region 前台--小组--话题页面
        /// <summary>
        /// 前台--小组--话题页面
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult SreachTopic(int id)
        {
            Topicshi top = new BaseBLL<Topicshi>().Search(id);
            if (top.TSTATE == 1)
            {
                return View(top);
            }
            else
            {
                return Content("<script> alert('此话题已关闭或删除！'); location.href = '/Home/Index';</script>");
            }
        }
        #endregion

        #region  前台---小组---话题回复
        public ActionResult addhuahui(Reply topic)
        {
            ReplyBLL topicbll = new ReplyBLL();
            topic.RTIME = DateTime.Now;
            bool s = topicbll.AddEntity(topic);
            if (s)
            {
                return Content("<script>alert('添加成功');location.href='/Group/SreachTopic/" + topic.TopicshiID + "'</script>");
            }
            else
            {
                return Content("<script>alert('失败');location.href='/Group/SreachTopic'</script>");
            }
        }
        #endregion

        #region 后台——运营——网站公告管理
        /// <summary>
        /// 后台——运营——网站公告管理
        /// </summary>
        /// <returns></returns>
        public ActionResult Announcement()
        {
            ViewBag.bulletin = bulletinbll.getEntityList(p => p.MSTARTTIMR < DateTime.Now && p.MFINISHTIME > DateTime.Now);
            Session["bulletin"] = ViewBag.bulletin;
            ViewBag.GetAll = bulletinbll.GetAll().OrderByDescending(p => p.MSTARTTIMR).ToList();
            return View();
        }
        #endregion

        #region 后台--运营--网站公告管理--添加网站公告(模态框)
        /// <summary>
        /// 后台--运营--网站公告管理--添加网站公告(模态框)
        /// </summary>
        /// <param name="b"></param>
        /// <returns></returns>
        public ActionResult announcementCreate(Bulletin b)
        {
            b.UserInfoId = (Session["User"] as UserInfo).UserInfoId;
            ViewBag.Uid = b.UserInfoId;
			b.MSTARTTIMR = DateTime.Now;
            bulletinbll.AddEntity(b);
            return RedirectToAction("Announcement");
        }
        #endregion


        #region 后台--运营--网站公告管理--编辑网站公告(模态框)
        /// <summary>
        /// 后台--运营--网站公告管理--编辑网站公告(模态框)
        /// </summary>
        /// <param name="b"></param>
        /// <returns></returns>
        public ActionResult announcementEdit(int id)
        {
            ViewBag.GetID = bulletinbll.Search(id);
            return View();
        }
        [HttpPost]
        public ActionResult announcementEdit(Bulletin b)
        {
            bulletinbll.Edit(b);
            return RedirectToAction("Announcement");
        }
        #endregion

        #region 后台--运营--网站公告管理--删除网站公告
        /// <summary>
        /// 后台--运营--网站公告管理--删除网站公告
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult announcementDel(int id)
        {
            bulletinbll.Del(bulletinbll.Search(id));
            return RedirectToAction("Announcement");
        }
        #endregion

        #region  后台——运营——全站站内通知
        /// <summary>
        /// 后台——运营——全站站内通知
        /// </summary>
        /// <returns></returns>
        public ActionResult Batch()
        {
            ViewBag.message = messagebll.GetAll().OrderByDescending(p => p.MESTARTTIME).ToList();
            //查找小组关系表
            List<UserAndGroup> uaglist = uagbll.GetAll();
            ViewBag.uaglist = uaglist;
            return View();
        }
        #endregion  后台——运营——全站站内通知

        #region 后台——运营——全站站内通知--点击标题查看
        /// <summary>
        ///  后台——运营——全站站内通知--点击标题查看
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult batchSend(int id)
        {
            ViewBag.send = messagebll.Search(id);
            return View();
        }
        #endregion

        #region 后台——运营——全站站内通知--发布
        /// <summary>
        ///  后台——运营——全站站内通知--发布
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult batchGetid(int id)
        {
            Message m = messagebll.Search(id);
            m.MRELEASETIME = DateTime.Now;
            m.MSTATE = 0;
            messagebll.Edit(m);
            return RedirectToAction("Batch");
        }
        #endregion

        #region 后台--运营--全站站内通知--创建全站站内通知
        /// <summary>
        /// 后台--运营--全站站内通知--创建全站站内通知
        /// </summary>
        /// <returns></returns>
        public ActionResult batchCreate()
        {
            return View();
        }
        [HttpPost]
        public ActionResult batchCreate(Message m)
        {
            m.UserInfoId = (Session["User"] as UserInfo).UserInfoId;//发布人
            m.MESTARTTIME = DateTime.Now;//添加时间
            //发布时间
            // m.MRELEASETIME = Convert.ToDateTime("--") ;
            //发布状态
            m.MSTATE = 1;
            messagebll.AddEntity(m);
            return RedirectToAction("Batch");
        }
        #endregion

        #region 后台--运营--全站站内通知--编辑全站站内通知
        /// <summary>
        /// 后台--运营--全站站内通知--编辑全站站内通知
        /// </summary>
        /// <returns></returns>
        public ActionResult batchEdit(int id)
        {
            Message m = messagebll.Search(id);
            return View(m);
        }
        #endregion

        #region 前台--通知--显示已发布的站内通知
        /// <summary>
        /// 前台--通知--显示已发布的站内通知
        /// </summary>
        /// <returns></returns>
        public ActionResult batchShow(int PageIndex = 1)
        {
            int PageSize = 2;
            List<Message> m = messagebll.GetAll().Where(p => p.MSTATE == 0).ToList();
            int PageCount = Convert.ToInt32(Math.Ceiling(m.Count() / (decimal)PageSize));
            if (PageCount < 1)
            {
                PageCount = 1;
            }
            m = m.OrderByDescending(p => p.MRELEASETIME).Skip((PageIndex - 1) * PageSize).Take(PageSize).ToList();
            ViewBag.show = m;
            ViewBag.PageIndex = PageIndex;
            ViewBag.PageSize = PageSize;
            ViewBag.PageCount = PageCount;
            return View();
        }
        #endregion

        #region 后台——运营——资讯——发布
        /// <summary>
        /// 后台——运营——资讯——发布
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult EditInfoState(int id)
        {
            Information str = infobll.Search(id);
            if (str.INSTATE == 0)
            {
                str.INSTATE = 1;
            }
            else
            {
                str.INSTATE = 0;
            }
            infobll.Edit(str);
            return RedirectToAction("GroupIndex");
        }
        #endregion

        #region 后台——运营——资讯——删除资讯
        /// <summary>
        /// 后台——运营——资讯——删除资讯
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult DelInfomation(int id)
        {
            Information sta = infobll.Search(id);
            infobll.Del(sta);
            return RedirectToAction("GroupIndex");
        }
        #endregion

        #region 修改
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult batchEdit(Message m)
        {
            m.UserInfoId = (Session["User"] as UserInfo).UserInfoId;//发布人
            m.MESTARTTIME = DateTime.Now;//添加时间
            //发布时间
            // m.MRELEASETIME = Convert.ToDateTime("--") ;
            //发布状态
            m.MSTATE = 1;
            //栏目列表
            List<Columnss> sta = colbll.GetAll();
            List<Columnss> stb = new List<Columnss>();
            foreach (var item in sta.Where(p => p.CLMGR == 0))
            {
                item.CLNAME =  item.CLNAME;
                stb.Add(item);
                int tt = 1;
                About(stb, sta, item.ColumnssID, tt);
            }
            ViewBag.collist = stb;
            messagebll.Edit(m);
            return RedirectToAction("Batch");
        }
        #endregion

        #region 上传图片
        /// <summary>
        /// 上传图片
        /// </summary>
        /// <param name="sta"></param>
        /// <param name="INIMAGE"></param>
        /// <returns></returns>
        public ActionResult EditInformationback(Information sta, HttpPostedFileBase INIMAGE)
        {
            //上传图片
            if (INIMAGE == null)
            {
                sta.INIMAGE = Request["touxiang"].ToString();
            }
            else
            {
                string FileNmae = DateTime.Now.ToString("yyyyMMddhhmmss") + Path.GetExtension(INIMAGE.FileName);
                string filePath = Path.Combine(Server.MapPath("/Img"), FileNmae);
                INIMAGE.SaveAs(filePath);
                sta.INIMAGE = FileNmae;
            }
            sta.ATTRIBUTE = Request["ATTRIBUTE"].ToString();
            infobll.Edit(sta);
            return RedirectToAction("GroupIndex");

        }
        #endregion

        #region 后台——运营——小组管理——开启、关闭小组
        /// <summary>
        /// 后台——运营——小组管理——开启、关闭小组
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult EditGroupState(int id)
        {
            Group sta = groupbll.Search(id);

            if (sta.GSTATE == 0)
            {
                sta.GSTATE = 1;
            }
            else
            {
                sta.GSTATE = 0;
            }
            groupbll.Edit(sta);
            return RedirectToAction("XGroup");

        }
        #endregion

        #region 后台——运营——小组管理——转移小组
        /// <summary>
        /// 后台——运营——小组管理——转移小组
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult EditGroupUser(int id)
        {
            //查找该小组的所有人数
            List<UserAndGroup> sta = uagbll.getEntityList(t => t.GroupID == id);
            ViewBag.uag = sta;
            //查找该小组的组长
            int uid = uagbll.getEntity(t => t.GPOSITION == 0).UserInfoID;
            ViewBag.std = uid;
            //记下需要修改的ID
            ViewBag.id = uagbll.getEntity(t => t.GPOSITION == 0 && t.GroupID == id).UserAndGroupID;
            //记下小组的id
            ViewBag.gid = id;

            return View();

        }
        #endregion

        #region 更改组长
        /// <summary>
        /// 更改组长
        /// </summary>
        /// <returns></returns>
        public ActionResult EditUserGroup()
        {
            //把原来的该小组组长换掉
            UserAndGroup str = uagbll.Search(Convert.ToInt32(Request["UserAndGroupID"]));
            str.GPOSITION = 2;
            uagbll.Edit(str);

            //把选中的用户换成组长
            int gid = Convert.ToInt32(Request["gid"]);
            int uid = Convert.ToInt32(Request["UserInfoID"]);

            UserAndGroup dml = uagbll.getEntity(t => (t.GroupID == gid) && (t.UserInfoID == uid));
            dml.GPOSITION = 0;
            uagbll.Edit(dml);
            return RedirectToAction("xiaogroup");
        }
        #endregion

        #region 后台--运营--全站站内通知--删除全站站内通知
        /// <summary>
        /// 后台--运营--全站站内通知--删除全站站内通知
        /// </summary>
        /// <returns></returns>
        public ActionResult batchDel(int id)
        {
            messagebll.Del(messagebll.Search(id));
            return RedirectToAction("Batch");
        }
        #endregion

        #region 添加资讯的树状结构
        /// <summary>
        /// 添加资讯的树状结构
        /// </summary>
        /// <param name="list2"></param>
        /// <param name="list3"></param>
        /// <param name="s"></param>
        /// <param name="tt"></param>
        public void About(List<Columnss> list2, List<Columnss> list3, int s, int tt)
        {
            

            foreach (var item in list3.Where(p => p.CLMGR == s).ToList())
            {
                item.CLNAME = item.CLNAME;
                list2.Add(item);
                int num = list3.Where(p => p.CLMGR == s).Count();
                if (num > 0)
                {
                    if (list3.Where(t => t.CLMGR == item.ColumnssID).Count() == 0)
                    {
                        About(list2, list3, item.ColumnssID, tt);
                    }
                    else
                    {
                        tt += 1;
                        About(list2, list3, item.ColumnssID, tt);
                    }
                }
            }

        }
        #endregion


        #region 后台——运营——小组管理
        /// <summary>
		/// 后台——运营——小组管理
		/// </summary>
		/// <returns></returns>
		public ActionResult xiaogroup(int? GSTATE, string GNAME, string Uname, int pageIndex = 1) {

            ViewBag.GSTATE = GSTATE;
            ViewBag.GNAME = GNAME;
            ViewBag.Uname = Uname;
            //根据条件查询集合 
            List<LeEdu.MODEL.Group> stalist = groupbll.GetAll().Where(t =>
                (GSTATE == null ? true : t.GSTATE == GSTATE)
                && (string.IsNullOrEmpty(GNAME) ? true : t.GNAME.Contains(GNAME))
                && (string.IsNullOrEmpty(Uname) ? true : t.UserAndGroup.Where(f => f.GroupID == t.GroupID && f.GPOSITION == 0).FirstOrDefault().Users.Uname.Contains(Uname))).ToList();
            ViewBag.group = NewPagingGroup(stalist, pageIndex);

			//ViewBag.GSTATE = GSTATE;
			//ViewBag.GNAME = GNAME;
			//ViewBag.Uname = Uname;
			////根据条件查询集合 
			//List<LeEdu.MODEL.Group> stalist = groupbll.GetAll().Where(t =>
			//	(GSTATE == null ? true : t.GSTATE == GSTATE)
			//	&& (string.IsNullOrEmpty(GNAME) ? true : t.GNAME.Contains(GNAME))
			//	&& (string.IsNullOrEmpty(Uname) ? true : t.UserAndGroup.Where(f => f.GroupID == t.GroupID && f.GPOSITION == 0).FirstOrDefault().Users.Uname.Contains(Uname))).ToList();
			//ViewBag.group = NewPagingGroup(stalist, pageIndex);

			//ViewBag.GSTATE = GSTATE;
			//ViewBag.GNAME = GNAME;
			//ViewBag.Uname = Uname;
			////根据条件查询集合 
			//List<LeEdu.MODEL.Group> stalist = groupbll.GetAll().Where(t =>
			//	(GSTATE == null ? true : t.GSTATE == GSTATE)
			//	&& (string.IsNullOrEmpty(GNAME) ? true : t.GNAME.Contains(GNAME))
			//	&& (string.IsNullOrEmpty(Uname) ? true : t.UserAndGroup.Where(f => f.GroupID == t.GroupID && f.GPOSITION == 0).FirstOrDefault().Users.Uname.Contains(Uname))).ToList();
			//ViewBag.group = NewPagingGroup(stalist, pageIndex);
            return View();
		}
        #endregion

        #region 后台——运营——小组管理
       /// <summary>
        /// 后台——运营——小组管理
        /// </summary>
        /// <returns></returns>
        public ActionResult XGroup(int? GSTATE, string GNAME, string Uname, int pageIndex = 1)
        {
            ViewBag.GSTATE = GSTATE;
            ViewBag.GNAME = GNAME;
            ViewBag.Uname = Uname;
            //根据条件查询集合 
            List<LeEdu.MODEL.Group> stalist = groupbll.GetAll().Where(t =>
                (GSTATE == null ? true : t.GSTATE == GSTATE)
                && (string.IsNullOrEmpty(GNAME) ? true : t.GNAME.Contains(GNAME))
                && (string.IsNullOrEmpty(Uname) ? true : t.UserAndGroup.Where(f => f.GroupID == t.GroupID && f.GPOSITION == 0).FirstOrDefault().Users.Uname.Contains(Uname))).ToList();
            ViewBag.group = NewPagingGroup(stalist, pageIndex);

            return View();
        }
        #endregion

        #region 根据条件分页和查询
        /// <summary>
        /// 根据条件分页和查询
        /// </summary>
        /// <param name="stalist"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public List<Group> NewPagingGroup(List<Group> stalist, int pageIndex)
        {
            //每页显示条数
            int pageSize = 2;

            int pageCount = Convert.ToInt32(Math.Ceiling(stalist.Count() / (decimal)pageSize));
			if (pageIndex>pageCount) {
				pageIndex = pageCount;
			}
            if (pageCount < 1)
            {
                pageCount = 1;
            }
            List<Group> stb = stalist.OrderBy(t => t.GroupID).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
            ViewBag.pageIndex = pageIndex;
            ViewBag.pagesize = pageSize;
            ViewBag.pageCount = pageCount;
            return stb;
        }
        #endregion

        #region 后台——运营——小组——跳转到话题界面
        /// <summary>
        /// 后台——运营——小组——跳转到话题界面
        /// </summary>
        /// <returns></returns>
        public ActionResult Threads(int ? TSTATE, string TATTRIBUTE, string GNAME, string TTITLE, string Uname, int pageIndex = 1)
        {
            UserInfoBLL ubll = new UserInfoBLL();
            int gid = 0;
            int uid = 0;
            if (GNAME == null ? true : false)
            {

            }
            else
            {
                gid = groupbll.getEntity(p => p.GNAME == GNAME).GroupID;
            }
            if (Uname == null ? true : false)
            {

            }
            else
            {
                uid = ubll.getEntity(p => p.Uname == Uname).UserInfoId;
            }

            List<LeEdu.MODEL.Topicshi> str = Topicbll.GetAll().
               Where(p => (TSTATE == null ? true : p.TSTATE == TSTATE)
                   && (string.IsNullOrEmpty(TATTRIBUTE) ? true : p.TATTRIBUTE == TATTRIBUTE)
                   && (gid == 0 ? true : p.GroupID == gid)
                   && (string.IsNullOrEmpty(TTITLE) ? true : p.TTITLE.Contains(TTITLE))
                   && (uid == 0 ? true : p.UserInfoID == uid)).ToList();
            int pageSize = 2;
            int pageCount = Convert.ToInt32(Math.Ceiling(str.Count / (double)pageSize));
            ViewData["pageCount"] = pageCount;

            List<LeEdu.MODEL.Topicshi> str1 = str.Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
            //根据条件查询集合 
            //List<LeEdu.MODEL.Topicshi> stalist = Topicbll.GetAll()
            //Where(t =>(TSTATE == null ? true : t.TSTATE == TSTATE)
            //    && (string.IsNullOrEmpty(GNAME) ? true : t.GNAME.Contains(GNAME))
            //    && (string.IsNullOrEmpty(Uname) ? true : t.UserAndGroup.Where(f => f.GroupID == t.GroupID && f.GPOSITION == 0).FirstOrDefault().Users.Uname.Contains(Uname))).ToList();
            //ViewBag.group = NewPagingGroup(stalist, pageIndex);
            ViewBag.topic = str1;
            return View();

        }
        #endregion

        #region 后台——运营——小组——修改话题的属性
        /// <summary>
        /// 后台——运营——小组——修改话题的属性
        /// </summary>
        /// <returns></returns>
        public ActionResult edittopic(int id, string str)
        {
            Topicshi sta = Topicbll.Search(id);
            if (sta.TATTRIBUTE.Contains(str))
            {
                sta.TATTRIBUTE = sta.TATTRIBUTE.Replace(str, "");
            }
            else
            {
                sta.TATTRIBUTE = sta.TATTRIBUTE.Insert(0, str);
            }


            Topicbll.Edit(sta);
            return Content("1");

        }
        #endregion

        #region 后台 -- 运营 -- 小组 -- 查看小组
        /// <summary>
        /// 后台 -- 运营 -- 小组 -- 查看小组
        /// </summary>
        /// <returns></returns>
        public ActionResult CheckGroup()
        {
            return View();
        }
        #endregion

        #region 后台——运营——小组——话题
        /// <summary>
        /// 后台——运营——小组——话题
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult EditTopicState(int id)
        {
            Topicshi sta = Topicbll.Search(id);
            if (sta.TSTATE == 0)
            {
                sta.TSTATE = 1;
            }
            else
            {
                sta.TSTATE = 0;
            }
            Topicbll.Edit(sta);
            return RedirectToAction("Threads");

        }
        #endregion

        #region 后台——运营——资讯——栏目管理
        /// <summary>
        /// 后台——运营——资讯——栏目管理
        /// </summary>
        /// <returns></returns>
        public ActionResult category()
        {
            //栏目列表
            List<Columnss> sta = colbll.GetAll();
            List<Columnss> stb = new List<Columnss>();
            foreach (var item in sta.Where(p => p.CLMGR == 0))
            {
                item.CLNAME =  item.CLNAME;
                stb.Add(item);
                int tt = 1;
                About(stb, sta, item.ColumnssID, tt);
            }
            ViewBag.collist = stb;
            return View();

        }
        #endregion

        #region 后台——运营——资讯——添加资讯
        /// <summary>
        /// 后台——运营——资讯——添加资讯
        /// </summary>
        /// <returns></returns>
        public ActionResult createInfo()
        {
            //栏目列表
            List<Columnss> sta = colbll.GetAll();
            List<Columnss> stb = new List<Columnss>();
            foreach (var item in sta.Where(p => p.CLMGR == 0))
            {
                item.CLNAME =  item.CLNAME;
                stb.Add(item);
                int tt = 1;
                About(stb, sta, item.ColumnssID, tt);
            }
            ViewBag.collist = stb;


            //所属标签
            List<Lable> stc = labll.GetAll();
            ViewBag.lalist = stc;

            return View();
        }
        #endregion

        #region 后台——运营——资讯——新建栏目
        /// <summary>
        /// 后台——运营——资讯——新建栏目
        /// </summary>
        /// <returns></returns>
        public ActionResult Addcategory(Columnss sta)
        {
            string str = "-L";
            sta.CLNAME = str + sta.CLNAME;
            sta.CLStarttime = DateTime.Now;
            colbll.AddEntity(sta);
            return RedirectToAction("category");

        }
        #endregion


        #region 后台——运营——栏目——编辑
        /// <summary>
        /// 后台——运营——栏目——编辑
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult EditGroup(int id)
        {
            //栏目列表
            List<Columnss> sta = colbll.GetAll();
            List<Columnss> stb = new List<Columnss>();
            foreach (var item in sta.Where(p => p.CLMGR == 0))
            {
                item.CLNAME = item.CLNAME;
                stb.Add(item);
                int tt = 1;
                About(stb, sta, item.ColumnssID, tt);
            }
            ViewBag.collist = stb;

            Columnss std = colbll.Search(id);
            ViewBag.sta = std;
            //int changdu = std.CLNAME.Length;
            //ViewBag.chang = changdu;
            return View();
        }
        #endregion

        #region 修改
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sta"></param>
        /// <returns></returns>
        public ActionResult EditCols(Columnss sta)
        {
            colbll.Edit(sta);
            return RedirectToAction("category");
        }
        #endregion

        #region  后台——运营——添加资讯
        /// <summary>
        /// 后台——运营——添加资讯
        /// </summary>
        /// <param name="sta"></param>
        /// <returns></returns>
        public ActionResult addinfo(Information sta)
        {
            string shu = Request["ATTRIBUTE"];
            if (Request["ATTRIBUTE"] == null)
            {
                shu = "";
            }

            sta.ATTRIBUTE = shu;
            sta.INIMAGE = "20151219091036.jpg";
            sta.INSTATE = 1;
            infobll.AddEntity(sta);
            return RedirectToAction("GroupIndex");

        }
        #endregion

        #region 后台——运营——资讯——属性
        /// <summary>
        /// 后台——运营——资讯——属性
        /// </summary>
        /// <returns></returns>
        public ActionResult editattr(int id, string str)
        {
            Information sta = infobll.Search(id);
            if (sta.ATTRIBUTE.Contains(str))
            {
                sta.ATTRIBUTE = sta.ATTRIBUTE.Replace(str, "");
            }
            else
            {
                sta.ATTRIBUTE = sta.ATTRIBUTE.Insert(0, str);
            }
            infobll.Edit(sta);
            return Content("1");
        }
        #endregion

        #region 后台——运营——资讯——编辑
        /// <summary>
        /// 后台——运营——资讯——编辑
        /// </summary>
        /// <returns></returns>
        public ActionResult EditInfomation(int id)
        {
            Information std = infobll.Search(id);
            ViewBag.infor = std;

            //栏目列表
            List<Columnss> sta = colbll.GetAll();
            List<Columnss> stb = new List<Columnss>();
            foreach (var item in sta.Where(p => p.CLMGR == 0))
            {
                item.CLNAME =  item.CLNAME;
                stb.Add(item);
                int tt = 1;
                About(stb, sta, item.ColumnssID, tt);
            }
            ViewBag.collist = stb;

            return View();
        }
        #endregion

        #region 删除话题
        /// <summary>
        /// 删除话题
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult DelTopic(int id)
        {
            Topicshi sta = Topicbll.Search(id);
            Topicbll.Del(sta);
            return RedirectToAction("threads");
        }
        #endregion

        #region 后台——运营——栏目管理——添加子栏目
        /// <summary>
        /// 后台——运营——栏目管理——添加子栏目
        /// </summary>
        /// <returns></returns>
        public ActionResult AddColumn(int id)
        {

            ViewBag.mgr = id;
            //栏目列表
            List<Columnss> sta = colbll.GetAll();
            List<Columnss> stb = new List<Columnss>();
            foreach (var item in sta.Where(p => p.CLMGR == 0))
            {
                item.CLNAME =  item.CLNAME;
                stb.Add(item);
                int tt = 1;
                About(stb, sta, item.ColumnssID, tt);
            }
            ViewBag.collist = stb;
            return View();
        }
        #endregion

        #region 前台---小组---加入小组
        /// <summary>
        /// 前台---小组---加入小组
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Jia(int id)
        {
            UserInfo user = Session["User"] as UserInfo;
            if (user == null)
            {
                return Content("<script>alert('未登录！请登录后在加入小组！');location.href='/Login/Index';</script>");
            }
            else
            {
                UserAndGroup uag = new UserAndGroup();
                uag.UserInfoID = user.UserInfoId;
                uag.GroupID = id;
                uag.STARTTIME = DateTime.Now;
                uag.GPOSITION = 2;

                new BaseBLL<UserAndGroup>().AddEntity(uag);
                return RedirectToAction("GroupHomepage/" + id + "");
            }
        }
        #endregion


        #region 前台--小组---退出小组
        /// <summary>
        /// 前台--小组---退出小组
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Tui(int id)
        {
            UserInfo user = Session["User"] as UserInfo;
            UserAndGroup uag = new BaseBLL<UserAndGroup>().GetAll().Where(p => p.GroupID == id && p.UserInfoID == user.UserInfoId).FirstOrDefault();
            new BaseBLL<UserAndGroup>().Del(uag);
            return RedirectToAction("GroupHomepage/" + id + "");
        }
        #endregion

        #region 批量删除话题
        /// <summary>
        /// 批量删除话题
        /// </summary>
        /// <param name="listid"></param>
        /// <returns></returns>
        public ActionResult DelthreadList(string listid)
        {
            string[] id = listid.Split(',');
            //循环删除id
            foreach (var item in id)
            {
                Topicbll.Del(Topicbll.Search(Convert.ToInt32(item)));
            }
            return Content("1");
        }
        #endregion

        #region 前台--修改小组话题页面
        /// <summary>
        /// 前台--修改小组话题页面
        /// </summary>
        /// <returns></returns>
        public ActionResult EditTopicShi(int id)
        {
            return View(Topicbll.Search(id));
        }
        #endregion
    }
}